/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.brucexx.wedding.model;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

/**
 *
 * @author Administrator
 */
public class FaceMapping {

    public static Map<String, String> map = new HashMap<String, String>();

    static {
        map.put("1", ":zc;");
        map.put("2", ":bf;");
        map.put("3", ":cy;");
        map.put("4", ":zsh;");
        map.put("5", ":su;");
        map.put("6", ":hh;");
        map.put("7", ":hy;");
        map.put("8", ":gun;");
        map.put("9", ":zs;");
        map.put("10", ":sl;");
        map.put("11", ":ax;");
        map.put("12", ":qiang;");
        map.put("13", ":jiong;");
        map.put("14", ":han;");
        map.put("15", ":by;");
        map.put("16", ":whhno;");
        map.put("17", ":cf;");
        map.put("18", ":bt;");
        map.put("19", ":wk;");
        map.put("20", ":sx;");
        map.put("21", ":ssn;");
        map.put("22", ":qs;");
        map.put("23", ":yl;");
        map.put("24", ":zombie;");
    }

    public static String getText(String picname) {
        return map.get(picname);
    }

    public static String getReplaceText(String text) {
        for (Iterator<Map.Entry<String, String>> iter = map.entrySet().iterator(); iter.hasNext();) {
            Map.Entry<String, String> entry = iter.next();
            text = text.replaceAll(entry.getValue(), "<img src='img/face/" + entry.getKey() + ".gif'/>");
        }
        return text;

    }

    public static void main(String args[]){
        System.out.println(getReplaceText("gg:whhno;fdsf"));
    }
}
